package com.itheima.mapper;

import com.itheima.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 部门管理
 */
@Mapper
public interface DeptMapper {


    /*查询全部部门数据的*/
    @Select("select * from dept")
    public List<Dept> list();

    @Delete("delete  from dept where id=#{id}")
    public  void deleteById( int id);


    @Insert("INSERT  into dept(name,create_time,update_time) values (#{name},#{createTime},#{updateTime})")
    public  void  add(Dept dept);




    @Update("UPDATE dept SET name=#{name} WHERE id=#{id}")
    public  void  updates(Dept dept);


    @Select("select * from dept where  id=#{id}")
    public Dept queryById(Integer id);
}
